﻿namespace wToggle.Platform.Interfaces
{
    using System;

    using Windows.UI.Xaml.Controls;

    public interface IAnalytics
    {
        void ReportException(Exception ex, bool isFatal = false);

        void ReportPageVisit(Page page);

        void Dispatch();

        void ReportEvent(EventCategory category, EventAction action, string label);
    }

    public enum EventAction
    {
        [AnalyticsEnumValue(Value = "timingStart")]
        TimingStart,

        [AnalyticsEnumValue(Value = "timingStop")]
        TimingStop,

        [AnalyticsEnumValue(Value = "timingDiscard")]
        TimingDiscard
    }

    public enum EventCategory
    {
        [AnalyticsEnumValue(Value = "timing")]
        Timing
    }

    [AttributeUsage(AttributeTargets.Field)]
    public class AnalyticsEnumValueAttribute : Attribute
    {
        public string Value { get; set; }
    }
}
